using System;
using System.Collections.Generic;
using System.Text;

namespace CodePlex.Resourceful.CommandLine
{
    public abstract class ActionInfo : BaseInfo
    {
        private readonly List<ParameterInfo> _parameters;

        public ActionInfo(string name, string description, params ParameterInfo[] parameters)
            : base(name, description)
        {
            _parameters = new List<ParameterInfo>(parameters);

          
        }



        public IEnumerable<ParameterInfo> Parameters
        {
            get
            {
                return _parameters;
            }
        }

        public IEnumerable<ParameterInfo> RequiredParameters
        {
            get
            {
                return _parameters.FindAll(delegate(ParameterInfo item)
                {
                    return item.IsRequired == true;
                });
            }
        }


        public abstract void Go(NameValuePairs parameters);

    }
}
